#include<bits/stdc++.h>
using namespace std;
int read(){int res=0,k=1;char ch;while(!isdigit(ch)){if(ch=='-')k=-1;ch=getchar();}
           while(isdigit(ch)){res=(res<<3)+(res<<1)+(ch-'0');ch=getchar();}return res*k;}
int n;
int a[100005];
int nextp(int p)
{
    for(int i=p+1;i<=n;i++)
        if(a[i]!=a[p])return i;
    return n+1;
}
int main()
{
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=read();
    for(int i=1;i<=n;i++)a[i]=read();
    sort(a+1,a+1+n);
    int l=1,r=nextp(1);
    if(r==n+1){cout<<n;return 0;}
    while(1)
    {
        if(a[l]==a[r])r=nextp(r);
        if(r>n)
        {
            cout<<n-l+1;
            return 0;
        }
        l++,r++;
    }
    return 0;
}
